package euler.p001_050;

import euler.MainEuler;

public class Euler007 extends MainEuler {

    /*
        By listing the first six prime numbers:
         2, 3, 5, 7, 11, and 13,
         we can see that the 6th prime is 13.

        What is the 10 001st prime number?

     */
    public String resolve(int position) {

        int i = 1;
        int n = 1;

        while (i < position) {
            if (primeHelper.isPrime(n+=2)) {
                i++;
            }
        }

        return String.valueOf(n);
        // 104743
    }
}
